<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        我是{{username}}今年{{userage}}
        电话是{{usertel}}
    </div>
</body>
<script>
    function Vue(option) {
        this.target = document.querySelector(option.el);//根据el找到作用范围
        //可以根据el 找到里面的内容  
        //内容中出现的 “内容” 在data中有  就直接使用data中的值去替换
        //let str = this.target.innerHTML;//获取里面的内容
        this.target.innerHTML = this.target.innerHTML.replace("{{username}}", option.data.username);
        this.target.innerHTML = this.target.innerHTML.replace("{{userage}}", option.data.userage);
        this.target.innerHTML = this.target.innerHTML.replace("{{usertel}}", option.data.usertel);
    }
    new Vue({
        el: "#app",
        data: {
            username: "leson",
            userage: 18,
            usertel: "15871437346"
        }
    })

</script>

</html>